package numarraylist;

import java.util.*;

public class NumArrayList {
    ArrayList<Integer> alist = new ArrayList<Integer>();

    NumArrayList(int[] nlist) {
        for (int i = 0; i < nlist.length; i++) {
            alist.add(nlist[i]);
        }
    }

    ArrayList<Integer> work() {
        Iterator<Integer> iter = alist.iterator();
        while (iter.hasNext()){
            if (iter.next() < 5000){
                iter.remove();
            }
        }
        return alist;
    }
}
